<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>文章评论管理</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="css/css.css" rel="stylesheet" type="text/css" />
	<link href="css/style.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="js/xiangmu.js"></script>
	<script type="text/javascript" src="js/jquery-1.9.1.js"></script>
  <script type="text/javascript">
  	//全选
	function checkAll(name)
	{
	  var names=document.getElementsByName(name);
	  var len=names.length;
	  if(len>0)
	  {
	   var i=0;
	   for(i=0;i<len;i++)
	   names[i].checked=true;
	    
	  }
	}
	
	//全不选
	function checkAllNo(name)
	{
	  var names=document.getElementsByName(name);
	 var len=names.length;
	 if(len>0)
	  {
	    var i=0;
	    for(i=0;i<len;i++)
	    names[i].checked=false;
	  }
	}
	
	//反选
	function reserveCheck(name)
	{
	  var names=document.getElementsByName(name);
	 var len=names.length;
	 if(len>0)
	 {
	 var i=0;
	   for(i=0;i<len;i++)
	   {
	     if(names[i].checked)
	     names[i].checked=false;
	     else
	     names[i].checked=true;
	     
	   }
	 } 
	
	}
	
	//检查是否选中	
function checked(name)
{
  var names=document.getElementsByName(name);
 var len=names.length;
 if(len>0)
 {
 		var i=0;
	   for(i=0;i<len;i++)
	   {
	     if(names[i].checked){
	    	 return 1;
	    	 }
	   }
 	  return 2;
 } 
 return 2;
}
	/* function XXX()
	  {
	   document.checkIds.submit();
	  }
	   */
 function XXX()	
  { 
  var a = checked("commentId");
  	 if(a==1){
     	document.checkIds.submit();    
		}else if(a==2){
		alert("至少选择一项");
     return  false; 
     }
 } 
	  
	  
  </script>
</head>
<body>
		<table id="mainpage" width="100%" border="0" cellspacing="0"
			cellpadding="0">
			<tr>
				<td height="30"><table width="100%" border="0" cellspacing="0"
						cellpadding="0">
						<tr>
							<td height="62" background="images/nav04.gif">
								<form action="" method="post">
								<table width="98%" border="0" align="center" cellpadding="0"
									cellspacing="0">
									<tr>
										<td width="21"><!-- <img src="images/ico07.gif" width="20" height="18" /> -->
										</td>
										<td width="550">
											<!-- 查看内容：按评论用户查询： 
											<select id="ajaxJsonSelectId" name="ads.adsPosId" style="width: 130px;" >
   												<option value="0">请选择</option>
    										</select> -->
											<span class="newfont06"></span> 
											<!-- <input name="Submit" type="button" class="right-button02" value="查询" /> -->
										</td>
									</tr>
								</table>
								</form>
								</td>
						</tr>
					</table></td>
			</tr>
			<tr>
				<td>
				<form name="checkIds" id="checkIds" method="post" action="admin/deleteComment">
				<table id="subtree1" style="DISPLAY: " width="100%"
						border="0" cellspacing="0" cellpadding="0">

						<tr>
							<td><table width="95%" border="0" align="center"
									cellpadding="0" cellspacing="0">

									<tr>
										<td height="20"><span class="newfont07">选择：
											<input type="radio" name="choice" id="ckall" onclick="checkAll('commentId','ckall')" />全选-
											<input type="radio"  name="choice" id="ckReserve" onclick="reserveCheck('commentId','ckReserve')" />反选
										</span> 
										<input  type="button" onclick="XXX()" class="right-button08" value="删除" /> 
									</tr>
									<tr>
										<td height="40" class="font42">
											<table width="100%" border="0" cellpadding="4" align="left"
												cellspacing="1" bgcolor="#464646" class="newfont03">
												<tr>
													<td height="20" colspan="6" align="center" bgcolor="#EEEEEE" class="tablestyle_title" >该文章评论列表</td>
												</tr>
												<tr>
													<td width="4%" align="center" bgcolor="#EEEEEE">选择</td>
													<td width="18%" align="center" bgcolor="#EEEEEE">文章</td>
													<td width="18%" align="center" bgcolor="#EEEEEE">评论内容</td>
													<td width="5%" align="center" bgcolor="#EEEEEE">评论得分</td>
													<td width="10%" align="center" bgcolor="#EEEEEE">评论时间</td>
													<td width="5%" align="center" bgcolor="#EEEEEE">操作</td>
												</tr>
												<c:forEach items="${requestScope.pages.records}" var="list">
													<tr align="center">
														<td  bgcolor="#FFFFFF"><input type="checkbox" name="commentId" value="${list.commentId }" /></td>
														<td align="left" bgcolor="#FFFFFF">${list.artical.title }</td>
														<td align="left" style="height:25px;overflow:hidden;" bgcolor="#FFFFFF">${list.content }</td>
														<td bgcolor="#FFFFFF">${list.score }</td>
														<td style="text-overflow:ellipsis;" bgcolor="#FFFFFF">${list.commDate }</td>
														<td align="center" bgcolor="#FFFFFF">
															<a href="admin/commentDetail.action?commentId=${list.commentId }">查看</a>
														</td>
													</tr>
												</c:forEach>
											</table>
											<jsp:include page="../../page.jsp" />
											</td>
									</tr>
								</table></td>
						</tr>
					</table>
					<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
						<tr>
							<td height="6"><img src="images/spacer.gif" width="1" height="1" /></td>
						</tr>
						<tr>
							<td height="33"></td>
						</tr>
					</table>
					</form>
					</td>
			</tr>
		</table>
		
	
</body>
</html>
